package Example;

class Base{
    int m=1;
    public Base() {
//        System.out.println(1);
    }
    public Base(String s){
        System.out.print("B");
    }
    public void a(){
        System.out.println("父类a方法");
    }
}
public class Derived extends Base{
    int m=2;
    public Derived(){
//        super("7");
//        System.out.println("w");
    }
    public Derived (String s) {
//        super("j");
        System.out.print("D");
    }
    public void a(){
        System.out.println("子类a方法");
    }
    public static void main(String[] args){
        Base b=new Derived();
        System.out.println(b.m);
        b.a();
        Derived d=new Derived();
        System.out.println(d.m);
        d.a();
        Base b1=new Base();
        System.out.println(b1.m);
        b1.a();
    }
}